<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>搜索结果</title>
    <link rel="stylesheet" th:href="@{/css/me.css}">
    <link rel="stylesheet" th:href="@{/css/semantic.min.css}">
</head>
<body class="m-body">

<!--头部导航-->
<div th:replace="common-2::headermenu(5)"></div>

<!--中间内容-->
<div class="m-padded-tb-large">

    <div class="m-container" th:styleappend="${pageInfo.size<3} ? 'height: 1000px'">
                <!--header-->
                <div class="ui segment">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <h3 class="ui teal header">搜索结果</h3>
                        </div>
                        <div class="right aligned column">
                            共 <h2 class="ui orange header m-inline-block m-text-thin">[[${pageInfo.total}]]</h2> 篇
                        </div>
                    </div>
                </div>

                <div class="ui stackable segment m-padded-tb-large m-padded-rl m-margin-b-large" th:if="${pageInfo.total==0}">
                    <div style="height: 500px;text-align: center">
                        <p class="m-text-style">——TOTALY 0 POSTS——</p>
                        <p class="m-text-thin m-padded-tb-large" style="font-size: 16px">这里空空如也</p>
                        <p class="m-text-thin" style="font-size: 16px">你再找找其他试试看吧..</p>
                    </div>
                </div>

                <!--content-->
                <!--<div class="ui segment">-->

                <div class="ui stackable segment m-padded-tb-large m-padded-rl m-margin-b-large" th:each="blog:${pageInfo.list}">
                    <div class="column">
                        <h3 class="ui header"><a th:href="@{/blog(id=${blog.id})}" style="color: #868e96">[[${blog.title}]]</a></h3>
                        <p class="m-text" th:text="${blog.content}"></p>
                        <div class="ui stackable grid">
                            <div class="twelve wide column">
                                <div class="ui horizontal link list">
                                    <div class="item">
                                        <img th:src="${blog.user.avatar}" width="100px" height="100px" class="ui avatar image">
                                        <div class="content">
                                            <div style="color: #868e96" class="header" th:text="${blog.user.nickname}">aQian</div>
                                        </div>
                                    </div>
                                    <div class="item">
                                        <i class="calendar icon"></i>[[${#dates.format(blog.createTime,'yyyy-MM-dd')}]]
                                    </div>
                                    <div class="item">
                                        <i class="eye icon"></i>[[${blog.views}]]
                                    </div>
                                </div>
                            </div>
                            <div class="right aligned three wide column">
                                <a th:href="@{/type(id=${blog.type.id})}" target="_blank" class="ui teal basic label m-padded-tb-mini-rl-tiny" th:text="${blog.type.name}"></a>
                            </div>
                        </div>
                    </div>
                </div>

                <!--</div>-->

                <!--footer-->
                <div class="ui bottom segment" th:if="${pageInfo.total>pageInfo.pageSize}">
                    <div class="ui middle aligned two column grid">
                        <div class="column">
                            <a th:href="@{/search(pageNum=${pageInfo.pageNum}-1,query=${query})}" th:if="${pageInfo.hasPreviousPage}" class="ui mini teal basic button">上一页</a>
                        </div>
                        <div class="right aligned column">
                            <a th:href="@{/search(pageNum=${pageInfo.pageNum}+1,query=${query})}" th:if="${pageInfo.hasNextPage}" class="ui mini teal basic button">下一页</a>
                        </div>
                    </div>
                </div>
    </div>
</div>

<!--底部footer-->
<div th:replace="common-2::footermenu"></div>
<!--script-->
<div th:replace="common-2::scriptmenu"></div>

<script type="text/javascript">
    $(function () {
        $("#btn").click(function () {
            $(".m-item").toggleClass('m-mobile-hide');
        })
    })
</script>
</body>
</html>